package com.example.async.controller;

import com.example.async.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private IUserService userService;

    @RequestMapping("/hi")
    public String sayHi() {
        System.out.println("开始执行方法，线程名：" +
                Thread.currentThread().getName());
        userService.method();
        System.out.println("结束执行方法，线程名：" +
                Thread.currentThread().getName());
        return "hi,spring boot";
    }
}
